unsigned char iterations(float re, float im)
{
	float cRe = re;
	float cIm = im;
	float zRe = 0, zIm = 0;
	unsigned char k = 0;

	while( (zRe*zRe + zIm*zIm <= 4) && (k < 255) ) {
		float zReOld = zRe;
		/* Compute z = z^2 + c */
		zRe = zRe*zRe - zIm*zIm + cRe;
		zIm = 2*zIm*zReOld + cIm;
		/* Increment iteration number */
		k += 1;
	}

	return k;
}
